import G6 from '@antv/g6';
// 默认节点配置
export const defaultNodeConfig = {
    backgroundConfig: {
        backgroundType: 'circle',
        fill: '#fff',
        stroke: 'LightSkyBlue',
        cursor: 'pointer',
    },
    type: 'center-node',
    color: '#40a9ff',
    size: 30,
    style: {
        fill: '#40a3f5',
        cursor: 'pointer',
    },
}

// 默认线条配置
export const defaultEdgeConfig = {
  type: 'line-lr',
  style: {
    stroke: '#8b9baf',
    lineWeight: 2,
    radius: 10,
    lineWidth: 2,
    endArrow: { 
      path: G6.Arrow.triangle(6, 6, 0),
      fill: '#3056E3',
    },
  },
};

// 默认布局配置
export const defaultLayout =  {
  type: 'compactBox',
  direction: 'LR',
  controlPoints: true,
  getId: function getId(d) {
    return d.id;
  },
  getHeight: function getHeight() {
    return 16;
  },
  getWidth: function getWidth(d) {
    return 140;
  },
  getVGap: function getVGap() {
    return 40;
  },
  getHGap: function getHGap() {
    return 30;
  },
};

export const defaultTBLayout = {
    type:'compactBox',
    direction: 'TB',
    getId: function getId(d) {
      return d.id;
    },
    getHeight: function getHeight() {
      return 16;
    },
    getWidth: function getWidth(d) {
      return 140;
    },
    getVGap: function getVGap() {
      return 40;
    },
    getHGap: function getHGap() {
      return 30;
    },
}
